/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package transferObject;

import java.awt.image.BufferedImage;
import util.HistogramEQ;
import util.Normalization;
import util.Utils;

/**
 *
 * @author Progresywny Maciek
 */
public class ProcessingImageTO {

    private BufferedImage frame;

    public BufferedImage getFrame() {
        return Utils.deepCopy(this.frame);
    }

    public void setFrame(BufferedImage frame) {
        this.frame = Utils.deepCopy(frame);
    }

    public BufferedImage preprocessing(int brightness, int contrast, boolean equalizeHistogram) {
        if(equalizeHistogram==true){
            frame= Utils.deepCopy(HistogramEQ.histogramEqualization(Normalization.BrightnessContrast(getFrame(), brightness, contrast)));
            return frame;
        }else{
            frame= Utils.deepCopy(Normalization.BrightnessContrast(getFrame(), brightness, contrast));
            return frame;
        }
    }

    public int getWidth() {
        return getFrame().getWidth();
    }

    public int getHeight() {
        return getFrame().getHeight();
    }
}
